<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>科研项目管理系统 - 新增项目</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            padding-top: 20px;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="card">
        <div class="card-header bg-primary text-white">
            <h1 class="h3">新增科研项目</h1>
        </div>
        <div class="card-body">
            <form action="/project/add" method="post" enctype="multipart/form-data" class="row g-3">
                <div class="col-md-12">
                    <label for="title" class="form-label">项目标题 <span class="text-danger">*</span></label>
                    <input type="text" id="title" name="title" class="form-control" required>
                </div>
                
                <div class="col-md-12">
                    <label for="description" class="form-label">项目描述</label>
                    <textarea id="description" name="description" class="form-control" rows="3"></textarea>
                </div>
                
                <div class="col-md-6">
                    <label for="collegeId" class="form-label">所属学院 <span class="text-danger">*</span></label>
                    <select id="collegeId" name="collegeId" class="form-select" required>
                        <option value="">请选择学院</option>
                        <option th:each="college : ${colleges}" th:value="${college.id}" th:text="${college.name}"></option>
                    </select>
                </div>
                
                <div class="col-md-6">
                    <label for="leader" class="form-label">项目负责人 <span class="text-danger">*</span></label>
                    <input type="text" id="leader" name="leader" class="form-control" required>
                </div>
                
                <div class="col-md-6">
                    <label for="startDate" class="form-label">开始日期 <span class="text-danger">*</span></label>
                    <input type="date" id="startDate" name="startDate" class="form-control" required>
                </div>
                
                <div class="col-md-6">
                    <label for="endDate" class="form-label">结束日期 <span class="text-danger">*</span></label>
                    <input type="date" id="endDate" name="endDate" class="form-control" required>
                </div>
                
                <div class="col-md-6">
                    <label for="status" class="form-label">项目状态 <span class="text-danger">*</span></label>
                    <select id="status" name="status" class="form-select" required>
                        <option value="1">筹备</option>
                        <option value="2">进行中</option>
                        <option value="3">已结题</option>
                    </select>
                </div>
                
                <div class="col-md-6">
                    <label for="file" class="form-label">上传附件（立项书/结题报告）</label>
                    <input type="file" id="file" name="file" class="form-control">
                </div>
                
                <div class="col-md-12">
                    <button type="submit" class="btn btn-primary">保存</button>
                    <a href="/project/list" class="btn btn-secondary">取消</a>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
</body>
</html>